package com.cbn.ibcp.web.smp.task;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.cbn.ibcp.common.thread.ExecutorServiceUtil;
import com.cbn.ibcp.jishiting.gs.cms.domain.Org;
import com.cbn.ibcp.jishiting.gs.cms.service.ICpVideoService;
import com.cbn.ibcp.jishiting.gs.cms.service.INodeVideoService;
import com.cbn.ibcp.jishiting.gs.cms.service.IOrgService;
import com.cbn.ibcp.jishiting.rms.enums.ResBaseOssInjectStatusEnum;
import com.cbn.ibcp.jishiting.rms.service.IResBaseService;
import com.cbn.ibcp.jishiting.statistic.domain.OrgInjectDataStatistic;
import com.cbn.ibcp.jishiting.statistic.domain.OssInjectDataStatistic;
import com.cbn.ibcp.jishiting.statistic.enums.DateTypeEnum;
import com.cbn.ibcp.jishiting.statistic.service.IOrgInjectDataStatisticService;
import com.cbn.ibcp.jishiting.statistic.service.IOssInjectDataStatisticService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.stream.Collectors;

/**
 * 定时任务
 * 注意: 在其他包新增定时任务,需添加白名单(Constants类 JOB_WHITELIST_STR)
 */
@Slf4j
@Component("task")
@RequiredArgsConstructor
public class Task {

    private final IOrgService orgService;

    private final IOssInjectDataStatisticService ossInjectDataStatisticService;

    private final IOrgInjectDataStatisticService orgInjectDataStatisticService;

    private final IResBaseService resBaseService;

    private final ICpVideoService cpVideoService;

    private final INodeVideoService nodeVideoService;

    /**
     * 生成源站注入统计数据
     */
    public void generateOssInjectDataStatistic(Integer dateType) {
        log.info("generateOssInjectDataStatistic param, dateType:{}", dateType);
        Date nowTime = new Date();
        DateTypeEnum dateTypeEnum = DateTypeEnum.getDateTypeEnum(dateType);
        if (dateTypeEnum == null) {
            log.error("generateOssInjectDataStatistic error, dateType is null,");
            return;
        }
        Date startTime = DateUtil.beginOfMinute(DateUtil.offsetMinute(nowTime, -dateTypeEnum.getValue()));
        Date endTime = DateUtil.endOfMinute(nowTime);
        OssInjectDataStatistic ossInjectDataStatistic = getOssInjectDataStatistic(startTime, endTime);
        ossInjectDataStatisticService.insert(ossInjectDataStatistic);
    }


    private OssInjectDataStatistic getOssInjectDataStatistic(Date startTime, Date endTime) {
        //rms创建时间统计
        Integer rmsAllTotalCreateInject = resBaseService.getTotalCreateInjectStatistic(null, null, null, null);
        Integer rmsAllTotalCreateInjecting = resBaseService.getTotalCreateInjectStatistic(null, null, null, ResBaseOssInjectStatusEnum.INJECTING.getCode());
        Integer rmsAllTotalCreateInjectSuccess = resBaseService.getTotalCreateInjectStatistic(null, null, null, ResBaseOssInjectStatusEnum.INJECT_SUCCESS.getCode());
        Integer rmsAllTotalCreateInjectFailure = resBaseService.getTotalCreateInjectFailureStatistic(null, null, null);
        //rms 更新时间统计
        Integer rmsAllTotalUpdateInject = resBaseService.getTotalUpdateInjectStatistic(null, null, null, null);
        Integer rmsAllTotalUpdateInjecting = resBaseService.getTotalUpdateInjectStatistic(null, null, null, ResBaseOssInjectStatusEnum.INJECTING.getCode());
        Integer rmsAllTotalUpdateInjectSuccess = resBaseService.getTotalUpdateInjectStatistic(null, null, null, ResBaseOssInjectStatusEnum.INJECT_SUCCESS.getCode());
        Integer rmsAllTotalUpdateInjectFailure = resBaseService.getTotalUpdateInjectFailureStatistic(null, null, null);
        //rms 时间段创建统计
        Integer rmsTotalCreateInject = resBaseService.getTotalCreateInjectStatistic(null, startTime, endTime, null);
        Integer rmsTotalCreateInjecting = resBaseService.getTotalCreateInjectStatistic(null, startTime, endTime, ResBaseOssInjectStatusEnum.INJECTING.getCode());
        Integer rmsTotalCreateInjectSuccess = resBaseService.getTotalCreateInjectStatistic(null, startTime, endTime, ResBaseOssInjectStatusEnum.INJECT_SUCCESS.getCode());
        Integer rmsTotalCreateInjectFailure = resBaseService.getTotalCreateInjectFailureStatistic(null, startTime, endTime);
        //rms 时间段更新统计
        Integer rmsTotalUpdateInject = resBaseService.getTotalUpdateInjectStatistic(null, startTime, endTime, null);
        Integer rmsTotalUpdateInjecting = resBaseService.getTotalUpdateInjectStatistic(null, startTime, endTime, ResBaseOssInjectStatusEnum.INJECTING.getCode());
        Integer rmsTotalUpdateInjectSuccess = resBaseService.getTotalUpdateInjectStatistic(null, startTime, endTime, ResBaseOssInjectStatusEnum.INJECT_SUCCESS.getCode());
        Integer rmsTotalUpdateInjectFailure = resBaseService.getTotalUpdateInjectFailureStatistic(null, startTime, endTime);
        //cdn 创建时间统计
        Integer cdnAllTotalCreateInject = cpVideoService.getTotalCreateInjectStatistic(null, null, null);
        Integer cdnAllTotalCreateInjecting = cpVideoService.getTotalCreateInjectStatistic(null, null, ResBaseOssInjectStatusEnum.INJECTING.getCode());
        Integer cdnAllTotalCreateInjectSuccess = cpVideoService.getTotalCreateInjectStatistic(null, null, ResBaseOssInjectStatusEnum.INJECT_SUCCESS.getCode());
        Integer cdnAllTotalCreateInjectFailure = cpVideoService.getTotalCreateInjectFailureStatistic(null, null);
        //cdn 更新时间统计
        Integer cdnAllTotalUpdateInject = cpVideoService.getTotalUpdateInjectStatistic(null, null, null);
        Integer cdnAllTotalUpdateInjecting = cpVideoService.getTotalUpdateInjectStatistic(null, null, ResBaseOssInjectStatusEnum.INJECTING.getCode());
        Integer cdnAllTotalUpdateInjectSuccess = cpVideoService.getTotalUpdateInjectStatistic(null, null, ResBaseOssInjectStatusEnum.INJECT_SUCCESS.getCode());
        Integer cdnAllTotalUpdateInjectFailure = cpVideoService.getTotalUpdateInjectFailureStatistic(null, null);
        // cdn 时间段创建统计
        Integer cdnTotalCreateInject = cpVideoService.getTotalCreateInjectStatistic(startTime, endTime, null);
        Integer cdnTotalCreateInjecting = cpVideoService.getTotalCreateInjectStatistic(startTime, endTime, ResBaseOssInjectStatusEnum.INJECTING.getCode());
        Integer cdnTotalCreateInjectSuccess = cpVideoService.getTotalCreateInjectStatistic(startTime, endTime, ResBaseOssInjectStatusEnum.INJECT_SUCCESS.getCode());
        Integer cdnTotalCreateInjectFailure = cpVideoService.getTotalCreateInjectFailureStatistic(startTime, endTime);
        // cdn 时间段更新统计
        Integer cdnTotalUpdateInject = cpVideoService.getTotalUpdateInjectStatistic(startTime, endTime, null);
        Integer cdnTotalUpdateInjecting = cpVideoService.getTotalUpdateInjectStatistic(startTime, endTime, ResBaseOssInjectStatusEnum.INJECTING.getCode());
        Integer cdnTotalUpdateInjectSuccess = cpVideoService.getTotalUpdateInjectStatistic(startTime, endTime, ResBaseOssInjectStatusEnum.INJECT_SUCCESS.getCode());
        Integer cdnTotalUpdateInjectFailure = cpVideoService.getTotalUpdateInjectFailureStatistic(startTime, endTime);
        //新增记录
        OssInjectDataStatistic ossInjectDataStatistic = new OssInjectDataStatistic();
        ossInjectDataStatistic.setDateId(DateUtil.format(endTime, "yyyyMMddHHmm"));
        ossInjectDataStatistic.setDateType(DateTypeEnum.MINUTE_DATE_TYPE_5_MINUTE.getValue());
        //rms创建时间统计
        ossInjectDataStatistic.setRmsAllTotalCreateInject(rmsAllTotalCreateInject.longValue());
        ossInjectDataStatistic.setRmsAllTotalCreateInjecting(rmsAllTotalCreateInjecting.longValue());
        ossInjectDataStatistic.setRmsAllTotalCreateInjectSuccess(rmsAllTotalCreateInjectSuccess.longValue());
        ossInjectDataStatistic.setRmsAllTotalCreateInjectFailure(rmsAllTotalCreateInjectFailure.longValue());
        //rms更新时间统计
        ossInjectDataStatistic.setRmsAllTotalUpdateInject(rmsAllTotalUpdateInject.longValue());
        ossInjectDataStatistic.setRmsAllTotalUpdateInjecting(rmsAllTotalUpdateInjecting.longValue());
        ossInjectDataStatistic.setRmsAllTotalUpdateInjectSuccess(rmsAllTotalUpdateInjectSuccess.longValue());
        ossInjectDataStatistic.setRmsAllTotalUpdateInjectFailure(rmsAllTotalUpdateInjectFailure.longValue());
        //rms 时间段创建数据统计
        ossInjectDataStatistic.setRmsTotalCreateInject(rmsTotalCreateInject.longValue());
        ossInjectDataStatistic.setRmsTotalCreateInjecting(rmsTotalCreateInjecting.longValue());
        ossInjectDataStatistic.setRmsTotalCreateInjectSuccess(rmsTotalCreateInjectSuccess.longValue());
        ossInjectDataStatistic.setRmsTotalCreateInjectFailure(rmsTotalCreateInjectFailure.longValue());
        //rms 时间段更新数据统计
        ossInjectDataStatistic.setRmsTotalUpdateInject(rmsTotalUpdateInject.longValue());
        ossInjectDataStatistic.setRmsTotalUpdateInjecting(rmsTotalUpdateInjecting.longValue());
        ossInjectDataStatistic.setRmsTotalUpdateInjectSuccess(rmsTotalUpdateInjectSuccess.longValue());
        ossInjectDataStatistic.setRmsTotalUpdateInjectFailure(rmsTotalUpdateInjectFailure.longValue());
        ossInjectDataStatistic.setCreateTime(new Date());
        //cdn创建时间统计
        ossInjectDataStatistic.setCdnAllTotalCreateInject(cdnAllTotalCreateInject.longValue());
        ossInjectDataStatistic.setCdnAllTotalCreateInjecting(cdnAllTotalCreateInjecting.longValue());
        ossInjectDataStatistic.setCdnAllTotalCreateInjectSuccess(cdnAllTotalCreateInjectSuccess.longValue());
        ossInjectDataStatistic.setCdnAllTotalCreateInjectFailure(cdnAllTotalCreateInjectFailure.longValue());
        //cdn更新时间统计
        ossInjectDataStatistic.setCdnAllTotalUpdateInject(cdnAllTotalUpdateInject.longValue());
        ossInjectDataStatistic.setCdnAllTotalUpdateInjecting(cdnAllTotalUpdateInjecting.longValue());
        ossInjectDataStatistic.setCdnAllTotalUpdateInjectSuccess(cdnAllTotalUpdateInjectSuccess.longValue());
        ossInjectDataStatistic.setCdnAllTotalUpdateInjectFailure(cdnAllTotalUpdateInjectFailure.longValue());
        // cdn 时间段创建时间统计
        ossInjectDataStatistic.setCdnTotalCreateInject(cdnTotalCreateInject.longValue());
        ossInjectDataStatistic.setCdnTotalCreateInjecting(cdnTotalCreateInjecting.longValue());
        ossInjectDataStatistic.setCdnTotalCreateInjectSuccess(cdnTotalCreateInjectSuccess.longValue());
        ossInjectDataStatistic.setCdnTotalCreateInjectFailure(cdnTotalCreateInjectFailure.longValue());
        // cdn 时间段更新时间统计
        ossInjectDataStatistic.setCdnTotalUpdateInject(cdnTotalUpdateInject.longValue());
        ossInjectDataStatistic.setCdnTotalUpdateInjecting(cdnTotalUpdateInjecting.longValue());
        ossInjectDataStatistic.setCdnTotalUpdateInjectSuccess(cdnTotalUpdateInjectSuccess.longValue());
        ossInjectDataStatistic.setCdnTotalUpdateInjectFailure(cdnTotalUpdateInjectFailure.longValue());
        return ossInjectDataStatistic;
    }


    /**
     * 生成分省注入统计数据
     */
    public void generateOrgInjectDataStatistic(Integer dateType, String tenantCodes) {
        log.info("generateOrgInjectDataStatistic param, dateType:{}", dateType);
        Date nowTime = new Date();
        DateTypeEnum dateTypeEnum = DateTypeEnum.getDateTypeEnum(dateType);
        if (dateTypeEnum == null) {
            log.error("generateOrgInjectDataStatistic error, dateType is null,");
            return;
        }
        if (StrUtil.isBlank(tenantCodes)) {
            log.error("generateOrgInjectDataStatistic error, tenantCodes is null,");
            return;
        }
        List<Org> orgList = orgService.selectList();
        Map<String, Org> orgMap = orgList.stream().collect(Collectors.toMap(Org::getCode, org -> org, (org1, org2) -> org1));
        List<String> tenantCodeList = StrUtil.split(tenantCodes, ",");
        Date startTime = DateUtil.beginOfMinute(DateUtil.offsetMinute(nowTime, -dateTypeEnum.getValue()));
        Date endTime = DateUtil.endOfMinute(nowTime);
        List<Callable<OrgInjectDataStatistic>> orgInjectDataStatisticCallableList = new ArrayList<>();
        for (String tenantCode : tenantCodeList) {
            orgInjectDataStatisticCallableList.add(() -> getOrgInjectDataStatistic(startTime, endTime, tenantCode));
        }
        List<OrgInjectDataStatistic> orgInjectDataStatisticList = ExecutorServiceUtil.execute(ExecutorServiceUtil.orgStatisticExecutorService, orgInjectDataStatisticCallableList);
        if (CollUtil.isNotEmpty(orgInjectDataStatisticList)) {
            for (OrgInjectDataStatistic orgInjectDataStatistic : orgInjectDataStatisticList) {
                orgInjectDataStatistic.setOrgName(orgMap.get(orgInjectDataStatistic.getOrgCode()).getName());
                orgInjectDataStatisticService.insert(orgInjectDataStatistic);
            }
        }
    }

    private OrgInjectDataStatistic getOrgInjectDataStatistic(Date startTime, Date endTime, String tenantCode) {
        //rms创建时间统计
        Integer rmsAllTotalCreateInject = resBaseService.getTotalCreateInjectStatistic(tenantCode, null, null, null);
        Integer rmsAllTotalCreateInjecting = resBaseService.getTotalCreateInjectStatistic(tenantCode, null, null, ResBaseOssInjectStatusEnum.INJECTING.getCode());
        Integer rmsAllTotalCreateInjectSuccess = resBaseService.getTotalCreateInjectStatistic(tenantCode, null, null, ResBaseOssInjectStatusEnum.INJECT_SUCCESS.getCode());
        Integer rmsAllTotalCreateInjectFailure = resBaseService.getTotalCreateInjectFailureStatistic(tenantCode, null, null);
        //rms 更新时间统计
        Integer rmsAllTotalUpdateInject = resBaseService.getTotalUpdateInjectStatistic(tenantCode, null, null, null);
        Integer rmsAllTotalUpdateInjecting = resBaseService.getTotalUpdateInjectStatistic(tenantCode, null, null, ResBaseOssInjectStatusEnum.INJECTING.getCode());
        Integer rmsAllTotalUpdateInjectSuccess = resBaseService.getTotalUpdateInjectStatistic(tenantCode, null, null, ResBaseOssInjectStatusEnum.INJECT_SUCCESS.getCode());
        Integer rmsAllTotalUpdateInjectFailure = resBaseService.getTotalUpdateInjectFailureStatistic(tenantCode, null, null);
        //rms 时间段创建统计
        Integer rmsTotalCreateInject = resBaseService.getTotalCreateInjectStatistic(tenantCode, startTime, endTime, null);
        Integer rmsTotalCreateInjecting = resBaseService.getTotalCreateInjectStatistic(tenantCode, startTime, endTime, ResBaseOssInjectStatusEnum.INJECTING.getCode());
        Integer rmsTotalCreateInjectSuccess = resBaseService.getTotalCreateInjectStatistic(tenantCode, startTime, endTime, ResBaseOssInjectStatusEnum.INJECT_SUCCESS.getCode());
        Integer rmsTotalCreateInjectFailure = resBaseService.getTotalCreateInjectFailureStatistic(tenantCode, startTime, endTime);
        //rms 时间段更新统计
        Integer rmsTotalUpdateInject = resBaseService.getTotalUpdateInjectStatistic(tenantCode, startTime, endTime, null);
        Integer rmsTotalUpdateInjecting = resBaseService.getTotalUpdateInjectStatistic(tenantCode, startTime, endTime, ResBaseOssInjectStatusEnum.INJECTING.getCode());
        Integer rmsTotalUpdateInjectSuccess = resBaseService.getTotalUpdateInjectStatistic(tenantCode, startTime, endTime, ResBaseOssInjectStatusEnum.INJECT_SUCCESS.getCode());
        Integer rmsTotalUpdateInjectFailure = resBaseService.getTotalUpdateInjectFailureStatistic(tenantCode, startTime, endTime);
        //cdn 创建时间统计
        Integer cdnAllTotalCreateInject = nodeVideoService.getTotalCreateInjectStatistic(tenantCode, null, null, null);
        Integer cdnAllTotalCreateInjecting = nodeVideoService.getTotalCreateInjectStatistic(tenantCode, null, null, ResBaseOssInjectStatusEnum.INJECTING.getCode());
        Integer cdnAllTotalCreateInjectSuccess = nodeVideoService.getTotalCreateInjectStatistic(tenantCode, null, null, ResBaseOssInjectStatusEnum.INJECT_SUCCESS.getCode());
        Integer cdnAllTotalCreateInjectFailure = nodeVideoService.getTotalCreateInjectFailureStatistic(tenantCode, null, null);
        //cdn 更新时间统计
        Integer cdnAllTotalUpdateInject = nodeVideoService.getTotalUpdateInjectStatistic(tenantCode, null, null, null);
        Integer cdnAllTotalUpdateInjecting = nodeVideoService.getTotalUpdateInjectStatistic(tenantCode, null, null, ResBaseOssInjectStatusEnum.INJECTING.getCode());
        Integer cdnAllTotalUpdateInjectSuccess = nodeVideoService.getTotalUpdateInjectStatistic(tenantCode, null, null, ResBaseOssInjectStatusEnum.INJECT_SUCCESS.getCode());
        Integer cdnAllTotalUpdateInjectFailure = nodeVideoService.getTotalUpdateInjectFailureStatistic(tenantCode, null, null);
        // cdn 时间段创建统计
        Integer cdnTotalCreateInject = nodeVideoService.getTotalCreateInjectStatistic(tenantCode, startTime, endTime, null);
        Integer cdnTotalCreateInjecting = nodeVideoService.getTotalCreateInjectStatistic(tenantCode, startTime, endTime, ResBaseOssInjectStatusEnum.INJECTING.getCode());
        Integer cdnTotalCreateInjectSuccess = nodeVideoService.getTotalCreateInjectStatistic(tenantCode, startTime, endTime, ResBaseOssInjectStatusEnum.INJECT_SUCCESS.getCode());
        Integer cdnTotalCreateInjectFailure = nodeVideoService.getTotalCreateInjectFailureStatistic(tenantCode, startTime, endTime);
        // cdn 时间段更新统计
        Integer cdnTotalUpdateInject = nodeVideoService.getTotalUpdateInjectStatistic(tenantCode, startTime, endTime, null);
        Integer cdnTotalUpdateInjecting = nodeVideoService.getTotalUpdateInjectStatistic(tenantCode, startTime, endTime, ResBaseOssInjectStatusEnum.INJECTING.getCode());
        Integer cdnTotalUpdateInjectSuccess = nodeVideoService.getTotalUpdateInjectStatistic(tenantCode, startTime, endTime, ResBaseOssInjectStatusEnum.INJECT_SUCCESS.getCode());
        Integer cdnTotalUpdateInjectFailure = nodeVideoService.getTotalUpdateInjectFailureStatistic(tenantCode, startTime, endTime);
        //新增记录
        OrgInjectDataStatistic orgInjectDataStatistic = new OrgInjectDataStatistic();
        orgInjectDataStatistic.setDateId(DateUtil.format(endTime, "yyyyMMddHHmm"));
        orgInjectDataStatistic.setDateType(DateTypeEnum.MINUTE_DATE_TYPE_5_MINUTE.getValue());
        orgInjectDataStatistic.setOrgCode(tenantCode);
        orgInjectDataStatistic.setCreateTime(new Date());
        //rms创建时间统计
        orgInjectDataStatistic.setRmsAllTotalCreateInject(rmsAllTotalCreateInject.longValue());
        orgInjectDataStatistic.setRmsAllTotalCreateInjecting(rmsAllTotalCreateInjecting.longValue());
        orgInjectDataStatistic.setRmsAllTotalCreateInjectSuccess(rmsAllTotalCreateInjectSuccess.longValue());
        orgInjectDataStatistic.setRmsAllTotalCreateInjectFailure(rmsAllTotalCreateInjectFailure.longValue());
        //rms更新时间统计
        orgInjectDataStatistic.setRmsAllTotalUpdateInject(rmsAllTotalUpdateInject.longValue());
        orgInjectDataStatistic.setRmsAllTotalUpdateInjecting(rmsAllTotalUpdateInjecting.longValue());
        orgInjectDataStatistic.setRmsAllTotalUpdateInjectSuccess(rmsAllTotalUpdateInjectSuccess.longValue());
        orgInjectDataStatistic.setRmsAllTotalUpdateInjectFailure(rmsAllTotalUpdateInjectFailure.longValue());
        //rms 时间段创建数据统计
        orgInjectDataStatistic.setRmsTotalCreateInject(rmsTotalCreateInject.longValue());
        orgInjectDataStatistic.setRmsTotalCreateInjecting(rmsTotalCreateInjecting.longValue());
        orgInjectDataStatistic.setRmsTotalCreateInjectSuccess(rmsTotalCreateInjectSuccess.longValue());
        orgInjectDataStatistic.setRmsTotalCreateInjectFailure(rmsTotalCreateInjectFailure.longValue());
        //rms 时间段更新数据统计
        orgInjectDataStatistic.setRmsTotalUpdateInject(rmsTotalUpdateInject.longValue());
        orgInjectDataStatistic.setRmsTotalUpdateInjecting(rmsTotalUpdateInjecting.longValue());
        orgInjectDataStatistic.setRmsTotalUpdateInjectSuccess(rmsTotalUpdateInjectSuccess.longValue());
        orgInjectDataStatistic.setRmsTotalUpdateInjectFailure(rmsTotalUpdateInjectFailure.longValue());
        //cdn创建时间统计
        orgInjectDataStatistic.setCdnAllTotalCreateInject(cdnAllTotalCreateInject.longValue());
        orgInjectDataStatistic.setCdnAllTotalCreateInjecting(cdnAllTotalCreateInjecting.longValue());
        orgInjectDataStatistic.setCdnAllTotalCreateInjectSuccess(cdnAllTotalCreateInjectSuccess.longValue());
        orgInjectDataStatistic.setCdnAllTotalCreateInjectFailure(cdnAllTotalCreateInjectFailure.longValue());
        //cdn更新时间统计
        orgInjectDataStatistic.setCdnAllTotalUpdateInject(cdnAllTotalUpdateInject.longValue());
        orgInjectDataStatistic.setCdnAllTotalUpdateInjecting(cdnAllTotalUpdateInjecting.longValue());
        orgInjectDataStatistic.setCdnAllTotalUpdateInjectSuccess(cdnAllTotalUpdateInjectSuccess.longValue());
        orgInjectDataStatistic.setCdnAllTotalUpdateInjectFailure(cdnAllTotalUpdateInjectFailure.longValue());
        // cdn 时间段创建时间统计
        orgInjectDataStatistic.setCdnTotalCreateInject(cdnTotalCreateInject.longValue());
        orgInjectDataStatistic.setCdnTotalCreateInjecting(cdnTotalCreateInjecting.longValue());
        orgInjectDataStatistic.setCdnTotalCreateInjectSuccess(cdnTotalCreateInjectSuccess.longValue());
        orgInjectDataStatistic.setCdnTotalCreateInjectFailure(cdnTotalCreateInjectFailure.longValue());
        // cdn 时间段更新时间统计
        orgInjectDataStatistic.setCdnTotalUpdateInject(cdnTotalUpdateInject.longValue());
        orgInjectDataStatistic.setCdnTotalUpdateInjecting(cdnTotalUpdateInjecting.longValue());
        orgInjectDataStatistic.setCdnTotalUpdateInjectSuccess(cdnTotalUpdateInjectSuccess.longValue());
        orgInjectDataStatistic.setCdnTotalUpdateInjectFailure(cdnTotalUpdateInjectFailure.longValue());
        return orgInjectDataStatistic;
    }
}
